		<div class="modal-content">
			<div class="modal-header btn-primary" >
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h4 class="modal-title">Cadastro Audiência/Perícia</h4>
			</div>
			<form id="form_audiencia_modal" class='form-horizontal' role='form'>
				<input type="hidden" name="numero_processo" value="<?php echo $nprocesso; ?>" >
				<input type="hidden" name="idprocesso" id="idprocesso" value="<?php echo $idprocesso; ?>" >
			<div class="modal-body">

				<div class="form-group">
					<label class="col-sm-2 control-label">Processo</label>
					<div class="col-sm-10">
						<p class="form-control-static">
						<?php 
						echo $nprocesso;
						?>
						</p>
					</div>
				</div>
				
				<div class="form-group">
				<label for="" class="col-sm-2 control-label">Tipo</label>
				<div class="col-sm-3">
					<?php 
						$class = 'class="form-control"';
						echo form_dropdown('tipoevento', $tipoevento, '',$class);
					?>
				</div>
				</div>
				<div class="form-group">
				<label for="" class="col-sm-2 control-label">Local</label>
				<div class="col-sm-4">
				<?php 
					/*$data = array('name'=> 'local','id'=> 'local','value'=> '','placeholder'=> 'Local','class'=> 'form-control input-sm');
					echo form_input($data);*/
					$class = 'class="form-control"';
					echo form_dropdown('local', $local, '',$class);
				?>
				</div>
				</div>
				
				<div class="form-group">
				<label for="" class="col-sm-2 control-label">Data</label>
				<div class="col-sm-3">
				<?php 
					$data = array('name'=> 'dia','id'=> 'diaaudiencia','value'=> '','placeholder'=> 'Data','class'=> 'form-control input-sm');
					echo form_input($data);
				?>
				</div>
				</div>
				<div class="form-group">
				<label for="inputPassword3" class="col-sm-2 control-label">Observação</label>
				<div class="col-sm-6">
				<?php 
					$data = array('name'=> 'observacao','id'=> 'observacao','placeholder'=> 'Observação','class'=> 'form-control input-sm','value'=>@$processo->observacao,'rows'=>'3');
					echo form_textarea($data);
				?>
				</div>
				</div>

				<div id="retorno4"></div>
				</div>
				<div class="modal-footer">	
					<button class="btn btn-primary" id="submit" type="submit" >Salvar</button>
					<a href="#" type="button"  data-dismiss="modal" class="btn btn-default">Cancelar</a>
					
				</div>
			</form>
		</div>
		<script language="javascript" type="text/javascript">
			$(document).ready(function(){//Equivalente ao window.onload porem mais rapido
				$('#diaaudiencia').datetimepicker({dateFormat: "dd/mm/yy"});
				$("#submit").click(function(){
					$("#form_audiencia_modal").validate({
						rules: {
							numero_processo: "required",
							dia: "required"
						},
						messages: {
							numero_processo: "Campo requerido",
							dia: "Campo requerido"
						},
						submitHandler: function(form){
							var dados = $('#form_audiencia_modal').serialize();
							$.ajax({
								type: "POST",
								url: "<?php echo base_url('index.php/eventos/salvar'); ?>",
								data: dados,
								success: function( data )
								{
									//alertify.success(data);
									if(data === 'OK'){
											$('#retorno4').html('<div class="alert alert-success" role="alert">CADASTRO EFETUADO COM SUCESSO</div>');
											setTimeout(function() {
												$('#retorno4').html('');
												//$('#audi_teste').load('<?php echo base_url('index.php/eventos/audienciaProcesso/'.$idprocesso);?>');
												/*
												$('#audi_teste').load('<?php echo base_url('index.php/processos/audienciaProcesso'); ?>',{
													'processo_id': $("#idprocesso").val()
													
													}
												);*/
												window.location = "<?php echo base_url('index.php/processos/info/'.$idprocesso); ?>";
											}, 1000);
											$('#addaudiencia').modal('hide');
										}else{
											$('#retorno4').html(data);
										}
								},
								statusCode: {
									404: function() {
										alertify.error("Pagina nao encontrada");
									}
								}
							});
							return false;
						}
					});				
				});
				
			});
	</script>
	